package jisuanke;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;


public class 无脑博士{
    static int[][][] map;
    //容量
    static int[] a = new int[3];
    //装的水的多少
    static int[] b = new int[3];
    static int[][] next = new int[][]{
            {0,1},
            {1,0},
            {0,2},
            {2,0},
            {1,2},
            {2,1}
    };
    static List<Integer> result;

    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        a[0] = scanner.nextInt();
        a[1] = scanner.nextInt();
        a[2] = scanner.nextInt();
        map = new int[a[0]+1][a[1]+1][a[2]+1];
        b[2] = a[2];
        result = new ArrayList<Integer>();
        function();
        Collections.sort(result);
        for(int i=0;i<result.size()-1;i++){
            System.out.print(result.get(i)+" ");
        }
        System.out.print(result.get(result.size()-1));
    }

    //尝试6种交换
    public static void function(){
        int d[] = new int[]{b[0],b[1],b[2]};
        //如果重复
        if(map[b[0]][b[1]][b[2]] == 1){
            return;
        }
        map[b[0]][b[1]][b[2]] = 1;
        //满足条件
        if(b[0] == 0){
            result.add(b[2]);
        }

        for(int i=0;i<=5;i++){
            //倒水
            function1(next[i][0],next[i][1]);
            function();
            //复原
            b[0] = d[0];
            b[1] = d[1];
            b[2] = d[2];
        }
    }

    //交换的实现  n2向n1倒水
    public static void function1(int n1,int n2){

        //n2有水 就倒水
        if(b[n2] != 0){
            //还有c装满n1
            int c = a[n1] - b[n1];
            //如果可以装满
            if(b[n2] >= c){
                b[n2] = b[n2] - c;
                b[n1] = a[n1];
            }
            //如果不能装满
            else{
                b[n1] = b[n1] + b[n2];
                b[n2] = 0;
            }
        }
    }

}

